package com.zsj.juc.thread;

import lombok.extern.slf4j.Slf4j;

/**
 * @author <a href="https://gitee.com/zhengshengjun">zsj</a>
 * @date 2023/12/6.
 */
@Slf4j
public class Test4 {

    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(3000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        }, "t1");
        log.debug("{}", t1.getState());//NEW
        t1.start();
        log.debug("{}", t1.getState());//RUNNABLE
        Thread.sleep(1000);
        log.debug("{}", t1.getState());//TIMED_WAITING

    }
}
